package mapengine.building
{
import isoengine.interfaces.IMapObjectData;

/**
 * MockMapBuilding
 * @author jliang
 *
 */
public class MockMapBuilding extends MapBuilding
{
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function MockMapBuilding(descriptor:Object=null)
	{
		super(descriptor);
	}
	
	public var assetReadyCallBack:Function;
	
	override public function get uid():String
	{
		return super.uid + "_mock";
	}
	
	override public function set objectData(value:IMapObjectData):void
	{
		super.objectData = value;
		
		x = y = 0;
		direction = 0;
	}
	
	override public function initialize():void
	{
		loadAsset(buildingItemValue.buildingTemplate.assetUrl, assetLoadedHandler);
	}
	
	override protected function assetReady():void
	{
		super.assetReady();
		
		if (assetReadyCallBack != null)
		{
			assetReadyCallBack(this);
		}
		assetReadyCallBack = null;
	}
}
}